<?php
	if ($_SESSION['sesi_login']!=true) {
		include "themes/admin-v2/login.php";
	} elseif (SHOWVIEW=="logout") {
		header("Location:modul/core/ver_admin.php?showview=logout");
		exit;
	} else {
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="keywords" name="keywords" content="aidiCMS, aidiCMS Control Panel" />
<META NAME="ROBOTS" CONTENT="NOINDEX,FOLLOW,NOIMAGEINDEX,NOIMAGECLICK">
<title>aidiCMS : <?php echo $DEV_ADMIN_CONTROL_PANEL; ?> - <?php echo $queryData->permalink("","",$rowQ->nama_modul); ?></title>
<?php
	if (isset($_SESSION['isroot'])) {
		echo '<link rel="stylesheet" type="text/css" media="screen" href="'.DIR_PATH.'themes/common/dhtml-horizroot.css" />';
		$logo = "logoroot.png";
	} else {
		echo '<link rel="stylesheet" type="text/css" media="screen" href="'.DIR_PATH.'themes/common/dhtml-horiz.css" />';
		$logo = "logo.png";
	}
?>
<link rel="stylesheet" type="text/css" media="screen" href="<?php echo DIR_PATH; ?>themes/admin-v2/style.css" />
<link rel="stylesheet" type="text/css" href="<?php echo DIR_PATH; ?>themes/common/lytebox.css" />
<link rel="stylesheet" type="text/css" href="<?php echo DIR_PATH; ?>themes/common/style.css" />
<link rel="stylesheet" type="text/css" href="<?php echo DIR_PATH; ?>modul/mod_kalender/themes/system.css" />
<script type="text/javascript" src="<?php echo DIR_PATH; ?>modul/mod_kalender/utils.js"></script>
<script type="text/javascript" src="<?php echo DIR_PATH; ?>modul/mod_kalender/calendar.js"></script>
<script type="text/javascript" src="<?php echo DIR_PATH; ?>modul/mod_kalender/calendar-en.js"></script>
<script type="text/javascript" src="<?php echo DIR_PATH; ?>modul/mod_kalender/calendar-setup.js"></script>
<script type="text/javascript" src="<?php echo DIR_PATH; ?>modul/js/stat.js"></script>
<script type="text/javascript" src="<?php echo DIR_PATH; ?>libs/jquery.js"></script>
<script type="text/javascript" src="<?php echo DIR_PATH; ?>libs/jquery.taboverride-1.0.min.js"></script>
<script type="text/javascript" language="javascript">
	var hours;
	var minutes;
	var seconds;
	var timer=null;
	function sClock() {
		hours=<?php echo date("H"); ?>;
		minutes=<?php echo date("i"); ?>;
		seconds=<?php echo date("s"); ?>;
		if(timer){clearInterval(timer);timer=null;}
		timer=setInterval("work();",1000);
	}
	
	function MM_validateForm() { //v4.0
		var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
		for (i=0; i<(args.length-2); i+=3) { 
			test=args[i+2];
			val=MM_findObj(args[i]);
			
			if (val) { 
				nm=val.id;
				if ((val=val.value)!="") {
					if (test.indexOf('isEmail')!=-1) { 
						p=val.indexOf('@');
						if (p<1 || p==(val.length-1)) errors+='- '+nm+' <?php echo $DEV_ACTION_VALID_EMAIL; ?>.\n';
					} else if (test!='R') { 
						num = parseFloat(val);
						if (isNaN(val)) errors+='- '+nm+' <?php echo $DEV_ACTION_VALID_NUMERIC; ?>.\n';
						if (test.indexOf('inRange') != -1) { 
							p=test.indexOf(':');
							min=test.substring(8,p); max=test.substring(p+1);
							if (num<min || max<num) errors+='- '+nm+' <?php echo $DEV_ACTION_VALID_CONTAIN; ?> '+min+' <?php echo $DEV_ACTION_VALID_AND; ?> '+max+'.\n';
						}
					}
				} else if (test.charAt(0) == 'R') errors += '- '+nm+' <?php echo $DEV_ACTION_VALID_EMPTY; ?>.\n'; 
			}
		} 
		if (errors) alert('<?php echo $DEV_ACTION_NOTIFICATION; ?>\n'+errors);
		document.MM_returnValue = (errors == '');
	}
</script>
<?php
	include_once "functions/func_mce_like.php"; 
?>
</head>
<body onload="sClock();ns9()">
<div id="header">
	<div id="subheader"><img src="themes/admin-v2/images/<?php echo $logo; ?>" height="70" /></div>
</div>
<div id="main">
	<div id="content"><?php show_content(SHOWVIEW); ?></div>
	<div id="subcontent"></div>
</div>
<div id="menu"><ul id="navmenu">
          <li><a href="?show=admin"><?php echo $DEV_ADMIN_HOME; ?></a>
            <ul>
              <li><a href="<?php echo DIR_PATH; ?>"><?php echo $DEV_ADMIN_MENU_MAIN_SITE; ?></a></li>
            </ul>
          </li>
          <li><a href="#"><?php echo $DEV_ADMIN_MENU_CONFIGURATION; ?></a>
            <ul>
              <?php echo $queryData->cekModul($_SESSION['admin_type'],'0'); ?>
            </ul>
          </li>
          <li><a href="#"><?php echo $DEV_ADMIN_MENU_ADMINISTER; ?></a>
            <ul>
              <?php echo $queryData->cekModul($_SESSION['admin_type'],'1'); ?>
            </ul>
          </li>
          <li><a href="#"><?php echo $DEV_ADMIN_MENU_APPLICATION; ?></a>
            <?php
		  	$i = 0;
		  	$sql = "SELECT view_mode,url FROM modul WHERE view_mode!='1' AND view_mode!='0' GROUP BY view_mode";
			$qry = mysql_query($sql);
			echo '<ul>';
			while ($row = mysql_fetch_object($qry)) {
				$url = dirname($row->url).'/langs/'.BASE_LANGUAGE.'.inc.php';
				(is_file($url)) ? include $url : '';
				if (is_array($MOD_NAME)) {
					$MOD_NAME = $MOD_NAME[0];
				} else $MOD_NAME = $MOD_NAME;
				echo '<li><a href="#">'.$MOD_NAME.'</a><ul>';
				echo $queryData->cekModul($_SESSION['admin_type'],$row->view_mode,true);
				echo '</ul></li>';
			}
			echo '</ul>';
		  ?>
          </li>
          <li><a href="?show=admin&amp;showview=logout"><?php echo $DEV_ADMIN_MENU_LOGOUT; ?></a></li>
        </ul></div>
<div id="footer">
<div id="footerleft"></div>
<div id="footerright"><?php echo footer(); ?></div>
</div>
</body>
</html>
<?php
	}
?>